<?php


namespace app\admin\service;

use EasyWeChat\Factory;

class Menu
{
    //设置公众号菜单
    public function setMenu(){
        $config = [
            'app_id' => config('ofcl.app_id'),
            'secret' => config('ofcl.app_secret'),

            'response_type' => 'array',

        ];

        $app = Factory::officialAccount($config);
        $buttons = config('common.menu');
        $res = $app->menu->create($buttons);
        print_r($res);
    }
}